//
//  PaddingDemo.swift
//  SwiftUIDemo
//
//  Created by Tilt Wang on 2025/6/25.
//

import SwiftUI

struct PaddingDemo: View {
    var body: some View {
        Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/)
            .background(Color.yellow)
//            .frame(width: 300, height: 100)
            .padding(.all, 10)
            .padding(.leading, 20)
            .padding(.horizontal, 30)
            .background(Color.blue)
        
        Text("Hello, World2!")
            .font(.largeTitle)
            .fontWeight(.semibold)
            .frame(maxWidth: .infinity, alignment: .leading)
            .background(Color.red)
//            .frame(width: 300, height: 100)
//            .padding(.all, 10)
            .padding(.leading, 20)
//            .padding(.horizontal, 30)
//            .background(Color.blue)
        
        VStack(alignment: .leading) {
            Text("Hello, World3!")
                .font(.largeTitle)
                .fontWeight(.semibold)
                .padding(.bottom, 20)
            
            Text("This is the description of what we will do on this screen. It is multiple lines and we will align the text to the leading edge.")
        }
//        .background(Color.blue)
        .padding()
        .padding(.vertical, 30)
        .background(
            Color.white
            .cornerRadius(10)
            .shadow(color: Color.black.opacity(0.4), radius: 10, x: 0.0, y: 10)
        )
        .padding(.horizontal, 10)
    }
}

#Preview {
    PaddingDemo()
}
